// /**
// //  * Magento
//  *
//  * NOTICE OF LICENSE
//  *
//  * This source file is subject to the Academic Free License (AFL 3.0)
//  * that is bundled with this package in the file LICENSE_AFL.txt.
//  * It is also available through the world-wide-web at this URL:
//  * http://opensource.org/licenses/afl-3.0.php
//  * If you did not receive a copy of the license and are unable to
//  * obtain it through the world-wide-web, please send an email
//  * to license@magentocommerce.com so we can send you a copy immediately.
//  *
//  * DISCLAIMER
//  *
//  * Do not edit or add to this file if you wish to upgrade Magento to newer
//  * versions in the future. If you wish to customize Magento for your
//  * needs please refer to http://www.magentocommerce.com for more information.
//  *
//  * @category    design
//  * @copyright   Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
//  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
//  */

.loader(
    @_loader-overlay-background-color: @loader-overlay-background-color,
    @_loader-overlay-z-index: @loader-overlay-z-index,
    @_loader-icon-width: @loader-icon-width,
    @_loader-icon-height: @loader-icon-height,
    @_loader-icon-background-color: @loader-icon-background-color,
    @_loader-icon-background-image: @loader-icon-background-image,
    @_loader-icon-background-position: @loader-icon-background-position,
    @_loader-icon-border-radius: @loader-icon-border-radius,
    @_loader-icon-padding: @loader-icon-padding,
    @_loader-text: @loader-text,
    @_loader-text-color: @loader-text-color,
    @_loader-text-font-size: @loader-text-font-size,
    @_loader-text-font-family: @loader-text-font-family,
    @_loader-text-font-weight: @loader-text-font-weight,
    @_loader-text-font-style: @loader-text-font-style,
    @_loader-text-padding: @loader-text-padding
) {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: @_loader-overlay-background-color;
    z-index: @_loader-overlay-z-index;
    &:before {
        .box-sizing();
        .add-padding(@_loader-icon-padding);
        background-color: @_loader-icon-background-color;
        background-image: @_loader-icon-background-image;
        background-position: @_loader-icon-background-position;
        background-repeat: no-repeat;
        border-radius: @_loader-icon-border-radius;
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        margin: auto;
        width: @_loader-icon-width;
        height: @_loader-icon-height;

        ._loader-text(@_loader-text);
    }
}

._loader-text(
    @_loader-text
) when (@_loader-text = true) {
    content: attr(data-text);
    padding: @_loader-text-padding;
    vertical-align: baseline;
    text-align: center;
    .typography(
        @_color: @_loader-text-color,
        @_font-size: @_loader-text-font-size,
        @_font-family: @_loader-text-font-family,
        @_font-weight: @_loader-text-font-weight,
        @_font-style: @_loader-text-font-style
    );
}

.loading(
    @_loading-background-color: @loading-background-color,
    @_loading-background-image: @loading-background-image
) {
    position: relative;
    &:before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        background-color: @_loading-background-color;
        background-image: @_loading-background-image;
        background-position: 50% 50%;
        background-repeat: no-repeat;
    }
}

.loading-mask() {
    bottom: 0;
    left: 0;
    margin: auto;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 100;
}
